import numpy as np

my_array = np.array([1, 2, 3, 4, 5])
print(my_array)
# [1 2 3 4 5]

print(my_array.shape)
# (5,)

my_zero_array = np.zeros((5))
print(my_zero_array)
# [0. 0. 0. 0. 0.]

my_one_array = np.ones((5))
print(my_one_array)
# [1. 1. 1. 1. 1.]

my_random_array = np.random.random((5))
print(my_random_array)
# [0.87517513 0.18978302 0.09080456 0.48390135 0.47497594]

my_2d_zero_array = np.zeros((2, 3))
print(my_2d_zero_array)
# [[0. 0. 0.]
#  [0. 0. 0.]]

my_2d_one_array = np.ones((2, 4))
print(my_2d_one_array)
# [[1. 1. 1. 1.]
#  [1. 1. 1. 1.]]

my_array = np.array([[4, 5], [6, 1]])
print(my_array)
# [[4 5]
#  [6 1]]
print(my_array.shape)
# (2, 2)
my_array_col_2 = my_array[:, 1]
print(my_array_col_2)
# [5 1]


a = np.array([[1.0, 2.0], [3.0, 4.0]])
b = np.array([[5.0, 6.0], [7.0, 8.0]])
sum = a + b
diff = a - b
prod = a * b
quot = a / b
print("Sum=", sum)
print("Diff=", diff)
print("Prod=", prod)
print("Quot=", quot)
# Sum= [[ 6.  8.]
#  [10. 12.]]
# Diff= [[-4. -4.]
#  [-4. -4.]]
# Prod= [[ 5. 12.]
#  [21. 32.]]
# Quot= [[0.2        0.33333333]
#  [0.42857143 0.5       ]]
